cmake_minimum_required(VERSION 3.4.1)

project(mixedprocess)

add_compile_options(-std=gnu99 -Wall)

SET(CMAKE_C_FLAGS_DEBUG "$ENV{CFLAGS} -O0 -g -ggdb")
SET(CMAKE_C_FLAGS_RELEASE "$ENV{CFLAGS} -O3 -s")
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 g -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -s")

set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(GEAR_LIBRARY_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third/gear-lib/output/linux)

include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/include
    ${GEAR_LIBRARY_PATH}/include
    ${CMAKE_CURRENT_SOURCE_DIR}/src
)

link_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/lib
    ${GEAR_LIBRARY_PATH}/debug/lib/gear-lib
)

file(GLOB_RECURSE SRC_LIST "src/*c")

add_executable(${PROJECT_NAME} ${SRC_LIST})
target_link_libraries(${PROJECT_NAME} file gevent skt hash darray pthread macro dl libdebug.so)